package cn.cvzhanshi.service.Impl;

import cn.cvzhanshi.dao.UserDao;
import cn.cvzhanshi.entity.User;
import cn.cvzhanshi.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author cVzhanshi
 * @create 2021-07-22 23:55
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    @Override
    public User login(User user) {
        User user1 = userDao.login(user);
        if (user1 != null) {
            return user1;
        }
        throw new RuntimeException("登录失败");
    }
}
